package com.axjy.service.impl;

import com.axjy.mapper.LineInfoMapper;
import com.axjy.pojo.LineInfo;
import com.axjy.service.LineInfoService;
import com.axjy.service.vo.Pager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by l on 2018/2/1.
 */
@Service("lineService")
public class LineInfoServiceImpl implements LineInfoService {

    @Resource
    private LineInfoMapper lineInfoMapper;

    @Override
    public List<LineInfo> search() {
        return lineInfoMapper.search();
    }

    @Override
    public Pager mhSearch(Integer offset, Integer limit, String lineCode, String runningStatusName) {
        Pager pager=new Pager();
        pager.setRows(lineInfoMapper.mhSearch(offset,limit,lineCode,runningStatusName));
        pager.setTotal(lineInfoMapper.searchTotal(lineCode,runningStatusName));
        return pager;
    }

    @Override
    public void addLine(LineInfo line) {
        lineInfoMapper.addLine(line);
    }

    @Override
    public void updateLine(LineInfo line) {
        lineInfoMapper.updateLine(line);
    }

    @Override
    public void delLine(String lineCode) {
        lineInfoMapper.delLine(lineCode);
    }

    @Override
    public void updateStart(Integer id, Integer isStart, Integer runningStatus,String runningStatusName) {
        lineInfoMapper.updateStart(id,isStart,runningStatus,runningStatusName);
    }
}
